﻿
var xmlhttp;
function verify(){
    var userName=document.getElementById("userName").value;

    if(window.XMLHttpRequest){

        xmlhttp =new XMLHttpRequest();

        if(xmlhttp.overrideMimeType){
            xmlhttp.overrideMimeType("text/xml");
        }
    }else if(window.ActiveXObject){

        var activexName=["MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
        for(var i=0;i<activexName.length;i++){
            try{

                xmlhttp = new ActiveXObject(activexName[i]);
                break;
            }catch(e){

            }
        }
    }

    xmlhttp.onreadystatechange = callback;


    xmlhttp.open("GET","ajaxservlet?name="+userName,true);


    xmlhttp.send(null);
}
function callback(){

    if(xmlhttp.readyState==4){

        if(xmlhttp.status==200){

            var responseText=xmlhttp.responseText;
           
            var divNode=document.getElementById("result");
            divNode.innerHTML=responseText;
        }
    }
}







